/*     */ package com.lmpop.trade.ti_download;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ 
/*     */ public class Ti_downloadInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_downloadInfo()
/*     */   {
/*  15 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  24 */     Ti_download ti_download = new Ti_download();
/*  25 */     ti_download.setDown_id(map.getString("down_id"));
/*  26 */     ti_download.setCust_id(map.getString("cust_id"));
/*  27 */     ti_download.setState_code(map.getString("state_code"));
/*  28 */     ti_download.setTitle(map.getString("title"));
/*  29 */     ti_download.setSize(map.getString("size"));
/*  30 */     ti_download.setType(map.getString("type"));
/*  31 */     ti_download.setUpdate_date(map.getString("update_date"));
/*  32 */     ti_download.setContact(map.getString("contact"));
/*  33 */     ti_download.setDownload_num(map.getInt("download_num"));
/*  34 */     ti_download.setDeveloper(map.getString("developer"));
/*  35 */     ti_download.setDev_link(map.getString("dev_link"));
/*  36 */     ti_download.setLanguage(map.getString("language"));
/*  37 */     ti_download.setCat_attr(map.getString("cat_attr"));
/*  38 */     ti_download.setPlatform(map.getString("platform"));
/*  39 */     ti_download.setContent(map.getString("content"));
/*  40 */     ti_download.setUp_num(0);
/*  41 */     ti_download.setDown_num(0);
/*  42 */     ti_download.setLink_sw(map.getString("link_sw"));
/*  43 */     ti_download.setUser_id(map.getString("user_id"));
/*     */ 
/*  45 */     String result_code = "0";
/*     */     try {
/*  47 */       insert(dbmMgr, ti_download);
/*     */     } catch (ApplicationException e) {
/*  49 */       e.printStackTrace();
/*  50 */       result_code = "1";
/*     */     }
/*  52 */     map.setString("result_code", result_code);
/*  53 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_download ti_download)
/*     */     throws ApplicationException
/*     */   {
/*  62 */     dbmMgr.update("insertTi_download", ti_download);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  72 */     String pkid_string = map.getString("pkid");
/*  73 */     String result_code = "0";
/*     */     try {
/*  75 */       if (!pkid_string.equals("")) {
/*  76 */         String[] pkStr = pkid_string.split("\\|");
/*  77 */         for (int i = 0; i < pkStr.length; i++) {
/*  78 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  82 */       e.printStackTrace();
/*  83 */       result_code = "1";
/*     */     }
/*  85 */     map.setString("result_code", result_code);
/*  86 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  95 */     dbmMgr.update("deleteTi_download", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 104 */     Ti_download ti_download = new Ti_download();
/* 105 */     ti_download.setDown_id(map.getString("down_id"));
/* 106 */     ti_download.setCust_id(map.getString("cust_id"));
/* 107 */     ti_download.setState_code(map.getString("state_code"));
/* 108 */     ti_download.setTitle(map.getString("title"));
/* 109 */     ti_download.setSize(map.getString("size"));
/* 110 */     ti_download.setType(map.getString("type"));
/* 111 */     ti_download.setUpdate_date(map.getString("update_date"));
/* 112 */     ti_download.setContact(map.getString("contact"));
/* 113 */     ti_download.setDownload_num(map.getInt("download_num"));
/* 114 */     ti_download.setDeveloper(map.getString("developer"));
/* 115 */     ti_download.setDev_link(map.getString("dev_link"));
/* 116 */     ti_download.setLanguage(map.getString("language"));
/* 117 */     ti_download.setCat_attr(map.getString("cat_attr"));
/* 118 */     ti_download.setPlatform(map.getString("platform"));
/* 119 */     ti_download.setContent(map.getString("content"));
/* 120 */     ti_download.setUp_num(map.getInt("up_num"));
/* 121 */     ti_download.setDown_num(map.getInt("down_num"));
/* 122 */     ti_download.setLink_sw(map.getString("link_sw"));
/* 123 */     ti_download.setIn_date(map.getString("in_date"));
/* 124 */     ti_download.setUser_id(map.getString("user_id"));
/*     */ 
/* 126 */     String result_code = "0";
/*     */     try {
/* 128 */       update(dbmMgr, ti_download);
/*     */     } catch (ApplicationException e) {
/* 130 */       e.printStackTrace();
/* 131 */       result_code = "1";
/*     */     }
/* 133 */     map.setString("result_code", result_code);
/* 134 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_download ti_download)
/*     */     throws ApplicationException
/*     */   {
/* 143 */     dbmMgr.update("updateTi_download", ti_download);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 153 */     Hashtable ti_download = (Hashtable)obj;
/* 154 */     if (start == 0)
/* 155 */       start = 0;
/*     */     else {
/* 157 */       start = (start - 1) * limit;
/*     */     }
/* 159 */     ti_download.put("start", Integer.valueOf(start));
/* 160 */     ti_download.put("limit", Integer.valueOf(limit));
/* 161 */     return this.queryList.getList("getListByTi_downloadPage", ti_download);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 173 */     Hashtable ti_download = (Hashtable)obj;
/* 174 */     List list = this.queryList.getList("getCountByObjTi_download", obj);
/* 175 */     int count = 0;
/* 176 */     if ((list != null) && (list.size() > 0)) {
/* 177 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 178 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 179 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 182 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 192 */     return this.queryList.getList("getTi_downloadByPk", pk);
/*     */   }
/*     */ 
/*     */   public String getSoftName(String pk)
/*     */   {
/* 202 */     List dList = this.queryList.getList("getTi_downloadByPk", pk);
/* 203 */     String title = "";
/* 204 */     if ((dList != null) && (dList.size() > 0)) {
/* 205 */       Hashtable sMap = (Hashtable)dList.get(0);
/* 206 */       if (sMap.get("title") != null) {
/* 207 */         title = sMap.get("title").toString();
/*     */       }
/*     */     }
/* 210 */     return title;
/*     */   }
/*     */ 
/*     */   public SysMap updateDownLoadState(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 224 */     String pkid_string = map.getString("pkid");
/* 225 */     String state_code = map.getString("state_code");
/* 226 */     String result_code = "0";
/*     */     try
/*     */     {
/* 229 */       if (!pkid_string.equals("")) {
/* 230 */         String[] pkStr = pkid_string.split("\\|");
/* 231 */         for (int i = 0; i < pkStr.length; i++)
/*     */         {
/* 233 */           Hashtable psMap = new Hashtable();
/* 234 */           psMap.put("down_id", pkStr[i]);
/*     */ 
/* 236 */           psMap.put("state_code", state_code);
/*     */ 
/* 238 */           if (pkStr[i].equals("")) continue; updateState(dbmMgr, psMap);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/* 242 */       e.printStackTrace();
/* 243 */       result_code = "1";
/*     */     }
/* 245 */     map.setString("result_code", result_code);
/* 246 */     return map;
/*     */   }
/*     */ 
/*     */   public void updateState(DbmInterf dbmMgr, Hashtable psMap)
/*     */     throws ApplicationException
/*     */   {
/* 256 */     dbmMgr.update("updateTi_downloadState", psMap);
/*     */   }
/*     */ 
/*     */   public List getMoreList(Hashtable map)
/*     */   {
/* 266 */     return this.queryList.getList("getMoreTi_downloadPage", map);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_download.Ti_downloadInfo
 * JD-Core Version:    0.6.0
 */